package engine.graphics.vfx
{
	import away3d.core.managers.*;
	import engine.graphics.*;
	import engine.graphics.anim.*;
	import engine.graphics.away3d.*;
	import engine.graphics.renderable.*;
	import engine.graphics.resources.*;
	import engine.graphics.sprite.*;
	import engine.loaders.*;
	import engine.math.*;
	
	public class RxWorldBaseFX
	{
		protected var m_state:uint;
		protected var m_visible:Boolean;
		protected var m_shaderFamily:RxShaderFamilyBaseFX;
		protected var m_shaderFeatures:uint;
		protected var m_color:RxVector4;
		protected var m_animColor:RxAnimatedParamVector4;
		protected var m_emissive:Number;
		protected var m_animEmissive:RxAnimatedParamScalar;
		protected var m_refractionTexture:RxGPUTexture2D;
		protected var m_refractionAnimTexture:RxAnimTextureSheet;
		protected var m_refractionScale:Number;
		protected var m_uvTransform:RxUVTransform;
		protected var m_animUVTransform:RxAnimatedParamUVTransform;
		protected var m_scale:Number;
		protected var m_animScale:RxAnimatedParamScalar;
		protected var m_depthBias:Number;
		protected var m_worldMatrix:RxMatrix4x4;
		protected var m_accumWorldMatrix:RxMatrix4x4;
		protected var m_texcMatrix0:RxMatrix4x4;
		protected var m_texcMatrix1:RxMatrix4x4;
		protected var m_trackedObject:RxLoader3D;
		protected var m_trackedJointIndex:int;
		protected var m_keepTracking:Boolean;
		protected var m_ignoreOrientation:Boolean;
		protected var m_startTime:Number;
		protected var m_endTime:Number;
		protected var m_age:Number;
		protected var m_timeScale:Number;
		protected var m_renderable:RxRenderableWorldFX;
		public static var STATE_DEAD:uint = 0;
		public static var STATE_ALIVE:uint = 1;
		public static var STATE_RENDERING:uint = 2;
		
		public function RxWorldBaseFX()
		{
			this.InitBaseFX();
			this.m_renderable = new RxRenderableWorldFX();
			this.m_renderable.SetWorldFX(this);
		}
		
		protected function InitBaseFX() : void
		{
			this.m_state = STATE_DEAD;
			this.m_visible = true;
			this.m_shaderFamily = null;
			this.m_shaderFeatures = 0;
			if (this.m_color == null)
			{
				this.m_color = new RxVector4(1, 1, 1, 1);
			}
			else
			{
				this.m_color.Set(1, 1, 1, 1);
			}
			this.m_animColor = null;
			this.m_emissive = 0;
			this.m_animEmissive = null;
			this.m_refractionTexture = null;
			this.m_refractionAnimTexture = null;
			this.m_refractionScale = 1;
			if (this.m_uvTransform == null)
			{
				this.m_uvTransform = new RxUVTransform();
			}
			else
			{
				this.m_uvTransform.Identity();
			}
			this.m_animUVTransform = null;
			this.m_scale = 1;
			this.m_animScale = null;
			this.m_depthBias = 0;
			if (this.m_worldMatrix == null)
			{
				this.m_worldMatrix = new RxMatrix4x4();
			}
			else
			{
				this.m_worldMatrix.Identity();
			}
			if (this.m_accumWorldMatrix == null)
			{
				this.m_accumWorldMatrix = new RxMatrix4x4();
			}
			else
			{
				this.m_accumWorldMatrix.Identity();
			}
			if (this.m_texcMatrix0 == null)
			{
				this.m_texcMatrix0 = new RxMatrix4x4();
			}
			else
			{
				this.m_texcMatrix0.Identity();
			}
			if (this.m_texcMatrix1 == null)
			{
				this.m_texcMatrix1 = new RxMatrix4x4();
			}
			else
			{
				this.m_texcMatrix1.Identity();
			}
			this.m_trackedObject = null;
			this.m_trackedJointIndex = -1;
			this.m_keepTracking = false;
			this.m_ignoreOrientation = false;
			this.m_startTime = 0;
			this.m_endTime = 0;
			this.m_age = 0;
			this.m_timeScale = 1;
		}
		
		public function Render(proxy:Stage3DProxy, camera:RxCamera3D) : void
		{
			
		}
		
		public function GetAccumWorldMatrix() : RxMatrix4x4
		{
			return this.m_accumWorldMatrix;
		}
		
		public function GetDepthBias() : Number
		{
			return this.m_depthBias;
		}
	}
}